package com.portal.framework.common.lang;

import java.io.Serializable;
/**
 * 
 * 名字、值对应类，类似Map，目前在分页中使用
 * 
 * @author 卢烁波
 * @date 2007-3-10
 */
public class NameValue<V> extends ObjectPair<V, String> implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3833748772134924341L;

	public NameValue() {
		super();
	}

	public NameValue(String key, V value) {
		super(value, key);
	}

	/**
	 * @return Returns the name.
	 */
	public String getName() {
		return getAttribute();
	}

	/**
	 * @param name
	 *            The name to set.
	 */
	public void setName(String name) {
		setAttribute(name);
	}

	public boolean sameIgnoreCase(String name) {
		if (name == null) {
			return this.getName() == null;
		}
		return name.equalsIgnoreCase(this.getName());
	}

}